﻿using UnityEngine;
using System.Collections;
using FrameWork;

public class StartGame : MonoBehaviour {

//     public override EnumUIType GetUIType()
//     {
//         return EnumUIType.TestOne;
//     }

	void Start () {
       UIManager.Intance.OpenUI(EnumUIType.TestOne);
        GameObject go = Instantiate(Resources.Load("Prefabs/TestOne")) as GameObject;
        TestOne tt = go.GetComponent<TestOne>();
        if (null == tt)
        {
           /* tt = */go.AddComponent<TestOne>();
           // close();
        }
//         float tm = System.Environment.TickCount;
//         for (int i = 1; i < 1000;i++ )
//         {
//             GameObject go = null;
//  //          go = Instantiate(Resources.Load<GameObject>("Prefabs/Cube"));
//  //           go.transform.position = UnityEngine.Random.insideUnitSphere * 10;
// 
//  //           go = ResManager.Intance.LoadInstance("Prefabs/Cube") as GameObject;
//  //            go.transform.position = UnityEngine.Random.insideUnitSphere * 10;
// 
//             ResManager.Intance.LoadAsyncInstance("Prefabs/Cube", (_obj) =>
//             {
//                 go = _obj as GameObject; 
//                 go.transform.position = UnityEngine.Random.insideUnitSphere * 10;
//             });


//             ResManager.Intance.LoadCoroutineInstance("Prefabs/Cube", (_obj) =>
//             {
//                 go = _obj as GameObject; 
//                 go.transform.position = UnityEngine.Random.insideUnitSphere * 10;
//             });
        }
       // Debug.LogError("Times:  "+ (System.Environment.TickCount - tm)*1000);
   
	public void close()
    {

      //  Destroy(this.gameObject);
    }
 }
